package org.xczy.boot.common;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class RabbitMQListener {

  @RabbitListener(queues = "queuesYX") // 监听
  public void listenerQueue(Message message){
    System.out.println(message);
    log.info("消费者为：{}",message);
  }
}